// CustomInputDialog.cpp
#include "CustomInputDialog.h"

CustomInputDialog::CustomInputDialog(const QStringList &labels, QWidget *parent)
    : QDialog(parent) {
    QFormLayout *layout = new QFormLayout(this);

    for (const QString &label : labels) {
        QLabel *labelWidget = new QLabel(label, this);
        QLineEdit *lineEdit = new QLineEdit(this);
        layout->addRow(labelWidget, lineEdit);
        lineEdits.append(lineEdit);
    }

    QPushButton *okButton = new QPushButton("OK", this);
    connect(okButton, &QPushButton::clicked, this, &QDialog::accept);
    layout->addWidget(okButton);

    setLayout(layout);
}

QStringList CustomInputDialog::getValues() const {
    QStringList values;
    for (const QLineEdit *lineEdit : lineEdits) {
        values << lineEdit->text();
    }
    return values;
}
